module.exports = function (_id, _viewstate, _opr, cb) {
  var http = require('http')
  var configs = require('./configs')
  var cookie = configs.cookie
  var qs = require('querystring')
// GET请求

  var state = qs.stringify({
    "smLabManage":"ID_PEE110101$upn|"+_opr,
    "hidRoleType":"",
    "ID_PEE110101$hidStudentId":_id,
    "ID_PEE110101$hidSemesterId":"6",
    "ID_PEE110101$hidCourseId":"7",
    "ID_PEE110101$ddlPageSize":"10",
    "ID_PEE110101$anpSP110201_input":"1",
    "ID_PEE110101$anpSP110202_input":"1",
    "__EVENTTARGET":_opr,
    "__EVENTARGUMENT":"",
    "__LASTFOCUS":"",
    "__VIEWSTATE":_viewstate,
    "__ASYNCPOST":"true"
  })
  var options = {
    method: "POST",
    hostname: "202.113.124.190",
    path: "/Page/PEE/PEECM/PEECM0001.aspx?flag=1&&action=PEE110101&&moduleId=PEE11",
    port: "8001",
    headers: {
      "Accept": "*/*",
      "Accept-Encoding": "gzip, deflate",
      "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
      "Cache-Control": "no-cache",
      "Connection": "keep-alive",
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
      "Content-Length": state.length,
      "Cookie": cookie,//////////////
      "Host": "202.113.124.190:8001",
      "Referer": "http://202.113.124.190:8001/Page/PEE/PEECM/PEECM0001.aspx?flag=1&&action=PEE110101&&moduleId=PEE11",
      "X-MicrosoftAjax": "Delta=true",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"
    }
  }
  var html = ""
  var req = http.request(options, function (res) {
    // 回调函数里拿到 response
    res.setEncoding('utf-8')
    res.on('data', function (chunk) {
      html += chunk;
    })
    res.on('end', function () {
      //console.log(html)
      console.log(res.statusCode+" choose")
      cb(html)
    })
  })
  req.on('error', function (err) {
    console.log(err.message)
  })
  req.write(state)
  req.end()

}